<?php

  //Similar to evenOdd but autoresets when pIndex is zero
class FP_View_Helper_AltClass
{
  public function altClass($pClass1, $pClass2, $pIndex){
    $sess = new Zend_Session_Namespace('silk_evenodd__');
    if (isset($sess->class) && $pIndex > 0){
      if ($sess->class == $pClass1)
        $sess->class = $pClass2;
      else if ($sess->class == $pClass2)
        $sess->class = $pClass1;
    } else {
      if ($pIndex == 0)
        $sess->class = $pClass1;
      else{
        if ($pIndex % 2 != 0)
          $sess->class = $pClass2;
        else
          $sess->class = $pClass1;
      }
    }
    return $sess->class;
  }
}


?>